package org.vectrics.common.file;


import java.io.File;

public class FileSpy {
    private long lastTouchTime = 0;
    
    public FileSpy() {
    	//
    }

    private String path;
    private String fileName;
    public String getPath() {
        return path;
    }
    public void setPath(String path) {
        this.path = path;
    }
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileName() {
        return fileName;
    }


    public boolean hasFileChanged() {
        boolean result = false;
        if (lastTouchTime <= 0) {
            result = true;
        }
        else {
            String fileAndPath = path + "/" + fileName;
            File file = new File(fileAndPath);
            long lastModified = file.lastModified();
            if (lastModified > lastTouchTime) {
                result = true;
            }
        }
        return(result);
    }

}